//
//  DCFViewUtils.m
//  DCF
//
//  Created by 吴文拼 on 2017/12/26.
//  Copyright © 2017年 吴文拼. All rights reserved.
//

#import "DCFViewUtils.h"

@implementation DCFViewUtils

#pragma mark --设置view的frame
+ (void)setViewTop:(UIView *)view top:(CGFloat)top {
    CGRect frame = view.frame;
    frame.origin.y = top;
    view.frame = frame;
}

+ (void)setViewLeft:(UIView *)view left:(CGFloat)left {
    CGRect frame = view.frame;
    frame.origin.x = left;
    view.frame = frame;
}

+ (void)setViewOrigin:(UIView *)view origin:(CGPoint)origin {
    CGRect frame = view.frame;
    frame.origin = origin;
    view.frame = frame;
}

+ (void)setViewWidth:(UIView *)view width:(CGFloat)width {
    CGRect frame = view.frame;
    frame.size.width = width;
    view.frame = frame;
}

+ (void)setViewHeight:(UIView *)view height:(CGFloat)height {
    CGRect frame = view.frame;
    frame.size.height = height;
    view.frame = frame;
}

+ (void)setViewSize:(UIView *)view size:(CGSize)size {
    CGRect frame = view.frame;
    frame.size = size;
    view.frame = frame;
}

+ (UIView *)addLineToView:(UIView *)view frame:(CGRect)frame color:(UIColor *)color{
    UIView *line = [[UIView alloc] initWithFrame:frame];
    line.backgroundColor = color;
    [view addSubview:line];
    return line;
}


@end
